package bitWork;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: tao
 * Date: 2023-12-09
 * Time: 14:34
 */
public class Work3 {
    public static void main(String[] args) {
        int[] num = {2,7,11,15};
        int target = 9;
        int x = 0, y = 0, len = num.length;
        for (int i = 0; i < len - 1; i++) {
            for (int j = 1; j < len - 1; j++) {
                if(num[i] + num[j] == target) {
                    x = i;
                    y = j;
                    break;
                }
            }
        }
        System.out.println("[" + x +", " + y + "]");
    }
}
